/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistence;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import vo.rb_daily_expences;

/**
 *
 * @author subin
 */
public class rb_daily_expences_persist {
    Session sess=null;
    Transaction tx=null;
    
    public static rb_daily_expences_persist getInstance() {
        return new rb_daily_expences_persist();
    }

    public rb_daily_expences_persist() {
    SessionFactory sf=new Configuration().configure().buildSessionFactory();
    sess=sf.openSession();
    tx=sess.beginTransaction();
    }
    
    public boolean insert(rb_daily_expences expence) {
                
        sess.save(expence);
        tx.commit();
        System.out.println("Done insertion");
        return true;
    }
}
